<template>
  <div class="educationadd">
    <div class="educationaddchild">
      <div class="educationaddchildcont">
        <p class="educationaddlift">开始时间</p>
      </div>
      <van-divider color="#E8E8E8" />

      <div>
        <van-form @submit="onSubmit">
          <van-field readonly clickable name="schoolname" :value="schoolname" placeholder="请选择开始时间"
            @click="showTime = true" :rules="[{ required: true, message: ' ' }]" />
          <van-popup v-model="showTime" position="bottom">
            <van-datetime-picker type="date" @confirm="onConfirmtimecjgz" @cancel="showTime = false" />
          </van-popup>
          <van-divider color="#E8E8E8" />
          <div style="margin: 16px;">
            <van-button round block type="info" native-type="submit">保存</van-button>
          </div>
        </van-form>
      </div>
    </div>
  </div>
</template>
<script>
export default {
  data () {
    return {
      schoolname: '',
      showTime: false
    }
  },
  computed: {},
  methods: {
    onSubmit () { },
    onConfirmtimecjgz (date) {
      let year = date.getFullYear()
      let month = date.getMonth() + 1
      let day = date.getDate()
      if (month >= 1 && month <= 9) {
        month = `0${month}`
      }
      if (day >= 1 && day <= 9) {
        day = `0${day}`
      }

      this.schoolname = `${year}-${month}-${day}`
      //  this.inputForm.cjgzdatetim = `${date.getMonth() + 1}-${date.getDate()}`
      this.showTime = false
    }
  },
  created () { }
}
</script>
<style scoped></style>
